package com.shxy.rlzy.controller;

import com.shxy.rlzy.common.lang.Result;
import com.shxy.rlzy.service.IDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通用数据控制器
 */
@RestController
@RequestMapping("/common")
public class CommonController extends BaseController {

    private IDictionaryService dictionaryService;
    @Autowired
    public void setDictionaryService(IDictionaryService dictionaryService) {
        this.dictionaryService = dictionaryService;
    }

    /**
     * 获取政治面貌列表
     * @return
     */
    @GetMapping("/politics")
    public Result getPolitics(){
        return Result.succ(dictionaryService.getPolitics());
    }

    /**
     * 获取民族列表
     * @return
     */
    @GetMapping("/ethics")
    public Result getEthics() {
        return Result.succ(dictionaryService.getEthics());
    }

    /**
     * 获取省份列表
     * @return
     */
    @GetMapping("/provinces")
    public Result getProvinces() {
        return Result.succ(dictionaryService.getProvinces());
    }

    /**
     * 获取学历列表
     * @return
     */
    @GetMapping("edu_exps")
    public Result getEduExps() {
        return Result.succ(dictionaryService.getEduExps());
    }

    /**
     * 获取学位列表
     * @return
     */
    @GetMapping("/edu_degrees")
    public Result getEduDegrees() {
        return Result.succ(dictionaryService.getEduDegrees());
    }

    /**
     * 获取合同类型列表
     * @return
     */
    @GetMapping("/contact_types")
    public Result getContactTypes() {
        return Result.succ(dictionaryService.getContactTypes());
    }

    /**
     * 获取合同期限列表
     * @return
     */
    @GetMapping("/contact_periods")
    public Result getContactPeriods() {
        return Result.succ(dictionaryService.getContactPeriods());
    }

    /**
     * 获取人员类别列表
     * @return
     */
    @GetMapping("/role_types")
    public Result getRoleTypes() {
        return Result.succ(dictionaryService.getRoleTypes());
    }

    /**
     * 获取婚姻状况列表
     * @return
     */
    @GetMapping("/marital_status")
    public Result getMaritalStatus() {
        return Result.succ(dictionaryService.getMaritalStatus());
    }

    /**
     * 获取健康状况列表
     * @return
     */
    @GetMapping("/healthy_types")
    public Result getHealthyTypes() {
        return Result.succ(dictionaryService.getHealthyTypes());
    }
}
